#include <iostream>
using namespace std;
#include <string>
#include <iomanip>
int main()
{
    struct Student
    {
         string name;
         int age[10];
         bool sex[10];
    };
    
    if(3>2)
    {

    }   
    else
    {
        
    };
    while()
    {

    };
    Student  zs;
    cin>>zs.name>>zs.age
    //zs.name = "lisi";
    //cout<<zs.name<<zs.age<<zs.sex;


     int sum = 0;
     int a;
     while(true)
     {
        
        cin >> a;
        if(a== -1)
        {
            break;
        }
        else
        {
           sum = sum + a;
        }
     }
     cout<<sum;
}